<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    

   let arr = [1,2,3,4]
    let arr2 = arr   //这不是深拷贝，只是复制了地址，所以修改arr2会影响arr
    //如何去复制一个对象，复制必须要产生新的对象
    //当调用splice时，会产生一个新的数组对象，从而完成对数组的赋值
    let arr3 = arr.slice() 
    console.log(arr==arr2);
    console.log(arr3==arr);
    
</script>
</html>